<?php


namespace Admin\Model;

use Think\Model;

class PermissionGroupModel extends Model{
    protected $tableName = "permission_group";

    public function group(){
        $res = M("permission_group ")
            ->select();
        if(false !== $res){
            return $res;
        }
    }
    
    public function groupFind($id){
        $res = M("permission_group ")
            ->where("id='$id'")    
            ->find(); 
        if(false !== $res){
            return $res;
        }
    }
    
    public function groupUpdate(){
        $this->create();
        return $this->save();        
    }
    
    public function grouplAdd($data){
        return $this->add($data);
    }

    public function groupDel($id){
        if(!$id)return;
        return $this->delete($id);
    }    
    
}